<<<<<<< .mine
google.load("visualization", "1", {packages:["corechart"]});
	
$(function(){
	
	var duration = 200;		// アニメーションスピード	
	
	$('.alpha_sort').click(function(){
		customConfirm('アルファベット順にしますか？',"",$(this),function(){
			$('#module_container > div').datasort({datatype: 'alpha'});
			$('#module_container div').map(function(idx, obj){
				$.cookie('module_'+idx, $(this).attr('id'), {expires : 30});
				$.cookie('side_module_'+idx, "side_"+$(this).attr('id'), {expires : 30});
			});
		},"e");
	});
	
	var set_sort = function(){
		$("#sections").sortable({
			handle : ".title",
			placeholder : "sort_placeholder",
			scroll:true,
			revert:200,
			tolerance:"pointer" ,
			start : function(){
			},
			deactivate : function(event, ui){
			}
		});
	}
	
	var a = 0;
	$('#lefttop .left a').click(function(){
		var sections = $('#sections');
		if(a == 0){
			a = 1;
			sections.fadeOut(duration,function(){
				$(" > section",sections)
					.addClass("sort")
					.each(function(){
						var p = "<p class='title'>" + $(this).attr("summary") + "</p>";
						$(this).append(p);
					});
					
					sections.fadeIn(duration,function(){
						set_sort();
						$('#lefttop .left a').html('<em class="order f"></em>完了</a>');
					});
			});
			
		}else {
			a = 0;
			sections.fadeOut(duration,function(){
				$(" > section",sections)
					.removeClass("sort");
				$('.title').remove();
				$('#lefttop .left a').html('<em class="order f"></em>並び替え</a>');
				
				sections.fadeIn(duration,function(){
					$(' > section',sections).map(function(idx, obj){
						$.cookie('section'+idx, $(this).attr('name'), {expires : 30});
					});
				});
			});
		}
	});
	
	$('#lefttop .center a').click(function(){
		$('h3 em').each(function(){
			if($(this).text() == "g"){
				$(this).parent().click();
			}
		});
	});
	
	$('#lefttop .right a').click(function(){
		$('h3 em').each(function(){
			if($(this).text() == "j"){
				$(this).parent().click();
			}
		});
	});
	
	
	/*-- カレンダー --------------------------------------------------------------------*/

	var beforeMoveStart,beforeMoveEnd;
	var calendar = $('#fullcalendar').fullCalendar({
		contentHeight: 250,
		//editable: true,
		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
		dayNamesShort: ['日','月','火','水','木','金','土'],
		header: {
			left: '',
			center: '',
			right: ''
		},
		titleFormat: {
			month: 'yyyy年 M月',
			week: '[yyyy年 ]M月 d日{ —[yyyy年 ][ M月] d日}',
			day: 'yyyy年 M月 d日 dddd'
		},
		buttonText: {
			today: '今日'
		},
		eventClick: function(calEvent, jsEvent, view) {
			//var y = calEvent.start.getFullYear();
			//var m = calEvent.start.getMonth()+1;
			//var d = calEvent.start.getDate();
			//location.href = "event_form.php?y=" + y + "&m=" + m + "&d=" + d + "&b=" + calEvent.id;
		},
		//eventDragStart: function(calEvent, jsEvent, view) {
		//	beforeMoveStart = calEvent.start;
		//	beforeMoveEnd = calEvent.end;
		//},
		//eventDrop: function(calEvent, jsEvent, view) {
		//	alert(calEvent.title +"\n"+ beforeMoveStart +" -> "+ calEvent.start +"\n"+ beforeMoveEnd +" -> "+ calEvent.end);
		//},
		events : []
	});
	
	var classes = ["hide","publ","prep"];
	var date = new Date();
	var yy = date.getFullYear();
	var thisMonth = date.getMonth();
	var mm = ((""+thisMonth).length == 1) ? Number("0"+thisMonth) : thisMonth;

	var nextMonth = (mm+1 == 13) ? "01" : mm+1;
	if((""+nextMonth).length == 1){nextMonth = "0"+nextMonth;}
	var nextYear = (nextMonth == "01") ? yy+1 : yy;
	var prevMonth = (mm-1 == 0) ? "12" : mm-1;
	if((""+prevMonth).length == 1){prevMonth = "0"+prevMonth;}
	var prevYear = (prevMonth == "12") ? yy-1 : yy;
	
	var days = {
		"01":"31",
		"02":"28",
		"03":"31",
		"04":"30",
		"05":"31",
		"06":"30",
		"07":"31",
		"08":"31",
		"09":"30",
		"10":"31",
		"11":"30",
		"12":"31"
	}
	
	var jFrom = "" + prevYear +""+ prevMonth +""+ days[prevMonth];
	var jTo = "" + nextYear +""+ nextMonth +""+ days[nextMonth];
	
	$.getJSON("http://sitemanage.shift-jp.net/web-admin/event_form.php?",
	{
		mode: "get",
		from: jFrom,
		to:jTo
	},
	function(data) {
		for(var i=0; i < data.length; i++){
			
			var cl = (data[i].color != "") ? "" : classes[data[i].status];
			
			calendar.fullCalendar('renderEvent',
				{
					id: data[i].id,
					title: data[i].event,
					start: data[i].start_date,
					end: data[i].end_date,
					allDay: true,
					color:"#"+data[i].color,
					textColor:"#ffffff",
					className: cl
				},
				true // make the event "stick"
			);
		}
	});
	
	$('#thisDate').html("<em>g</em>" + yy +"/"+ (thisMonth+1) + "の予定");

	
	/*-- インフォメーション --------------------------------------------------------------------*/
	
	var informationPopup = function(type,n){
		
		var url = 'information_popup_' + type + '.php';
		if(n){url += "?param=" + n;}
		
		if($('#informationModal').size() == 0){
			var html = '<div id="informationModal" class="mcon">';
			html += '<span class="close_btn"><a href="javascript:;">b</a></span>';
			html += '<h3>Information</h3>';
			html += '<iframe id="informationModal_i" src="'  + url + '"></iframe>';
			html += '</div>';
			$('body').append(html);
			$("#informationModal").draggable({handle:"h3"});
		}else {				
			$('#informationModal_i').attr('src',url);
		}
		
		toggleInfoModal(true);
		
	}
	
	var toggleInfoModal = function(s){
		if(s == true){
			$('body').append('<div id="modal_background">&nbsp;</div>');
			$('#modal_background').fadeIn(300).height($(document).height());
			$('#informationModal')
				.show()
				.css({
					"position":"absolute",
					"opacity":0,
					'top':($(document).scrollTop())+'px'})
				.animate({"opacity":1,"top":($(document).scrollTop()+50)+"px"},300);
			$('#modal_background , .close_btn').click(function(){
				toggleInfoModal(false);
			});
		}else {
			$('#modal_background').fadeOut(300,function(){$(this).remove();});
			$('#informationModal')
				.css({"position":"absolute"})
				.animate({"opacity":0,"top":$(document).scrollTop()+'px'},300,
				function(){
					$(this).hide();
				});
		}
	}

	/*-- グラフ --------------------------------------------------------------------*/
	
	var access = renderChart({
		"title":"",
		"datatable":"#data_access",
		"item_title":0,
		"item_data1":1,
		"renderTo":'graph_access',
		"height":300,
		"top":10

	});
	//access.renderLine();
	
	var pageview = renderChart({
		"title":"",
		"datatable":"#data_pageview",
		"item_title":0,
		"item_data1":1,
		"renderTo":'graph_pageview',
		"height":300,
		"top":10
	});
	//pageview.renderColumn();
	
	$('#graphs .btns_mini .left a').click(function(){
		var p = $(this).closest("div");
		$("div,table",p).hide();
		$("div",p).show();
	});
	
	$('#graphs .btns_mini .right a').click(function(){
		var p = $(this).closest("div");
		$("div,table",p).hide();
		$("table",p).show();
	});
	
	
	/*-- プラグイン --------------------------------------------------------------------*/
	
	var container = $('#module_container');
	
	var set_compact_event = function(b){
		if(b){
			$('.compact div').unbind();
			//hoverイベント
			$('.compact div').hover(
				function(){
					var top = ($('ul',this).height()+136);
					$('ul',this)
						.slideDown(200);
				},
				function(){
					$('ul',this).slideUp(200);
				}
			);
			$('div ul',container).hide();
		}else {
			$('.open div').unbind();
			$('div ul',container).show();
		}
	}
	
	$('#modules .btns_mini .left a').click(function(){
		if(!container.hasClass('open')){
			container.fadeOut(duration,function(){
				container
					.removeClass("compact")
					.addClass("open")
					.fadeIn(duration);
					set_compact_event(false);
			});
			
			$.cookie('plugin_mode', 'open', {expires : 30});
		}
	});
	
	$('#modules .btns_mini .right a').click(function(){
		if(!container.hasClass('compact')){
			container.fadeOut(duration,function(){
				container
					.removeClass("open")
					.addClass("compact")
					.fadeIn(duration);
					set_compact_event(true);
			});
			
			$.cookie('plugin_mode', 'compact', {expires : 30});
		}
	});
	
	
	/*-- cookieから配置再現 --------------------------------------------------------------------*/

	if($.cookie('plugin_mode') == 'compact'){
		container.addClass('compact');
		$('#modules .btns_mini .right a').addClass('active');
		set_compact_event(true);
	}else {
		container.addClass('open');
		$('#modules .btns_mini .left a').addClass('active');
	}
	
	var max = $('#sections > section').length -1 ;
	for(var i = max; i >= 0; i--){
		var section_id = $.cookie('section'+i);
		$('section[name='+section_id+']').prependTo('#sections');
	}
	
	/*-- 折りたたみ --------------------------------------------------------------------*/
	
	var min_h = $('#panels h3').height();
	
	$('.top_content').each(function(){
		$(this).attr("rel",$(this).height());
	});
	
	$('.top_content h3.ctrl').click(function(){
		var p = $(this).closest(".top_content");
		var h = min_h;
		
		if(p.height() == min_h){
			$('h3 em',p).text('g');
			h = p.attr("rel");
		}else {
			$('h3 em',p).text('j');
		}
		$(this).closest(".top_content")
			.animate({
				"height":h+"px"
			},300);
	});
	
	$('#sections').css("visibility","visible")
	$('#article').removeClass("load");
	
=======
$(function(){

	var sections = $('#sections');
	var modules = $('#modules');
	var module_container = $('#module_container');

	var duration = 200;		// アニメーションスピード

	$('.alpha_sort').click(function(){
		customConfirm('アルファベット順にしますか？',"",$(this),function(){
			$(' > div',module_container).datasort({datatype: 'alpha'});
			$('div',module_container).map(function(idx, obj){
				$.cookie('module_'+idx, $(this).attr('id'), {expires : 30});
				$.cookie('side_module_'+idx, "side_"+$(this).attr('id'), {expires : 30});
			});
		},"e");
	});

	var set_sort = function(){
		sections.sortable({
			handle : ".title",
			placeholder : "sort_placeholder",
			scroll:true,
			revert:200,
			tolerance:"pointer" ,
			start : function(){
			},
			deactivate : function(event, ui){
			}
		});
	}

	var a = 0;
	var lefttop = $('#lefttop');
	$('.left a',lefttop).click(function(){
		if(a == 0){
			a = 1;
			sections.fadeOut(duration,function(){
				$(" > section",sections)
					.addClass("sort")
					.each(function(){
						var p = "<p class='title'>" + $(this).attr("summary") + "</p>";
						$(this).append(p);
					});

					sections.fadeIn(duration,function(){
						set_sort();
						$('.left a',lefttop).html('<em class="order f"></em>完了</a>');
					});
			});

		}else {
			a = 0;
			sections.fadeOut(duration,function(){
				$(" > section",sections)
					.removeClass("sort");
				$('.title').remove();
				$('.left a',lefttop).html('<em class="order f"></em>並び替え</a>');

				sections.fadeIn(duration,function(){
					$(' > section',sections).map(function(idx, obj){
						$.cookie('section'+idx, $(this).attr('name'), {expires : 30});
					});
				});
			});
		}
	});

	$('.center a',lefttop).click(function(){
		$('h3 em').each(function(){
			if($(this).text() == "g"){
				$(this).parent().click();
			}
		});
	});

	$('#lefttop .right a').click(function(){
		$('h3 em').each(function(){
			if($(this).text() == "j"){
				$(this).parent().click();
			}
		});
	});


	/*-- カレンダー --------------------------------------------------------------------*/

	var beforeMoveStart,beforeMoveEnd;
	var calendar = $('#fullcalendar').fullCalendar({
		contentHeight: 250,
		//editable: true,
		dayNames: ['日曜日','月曜日','火曜日','水曜日','木曜日','金曜日','土曜日'],
		dayNamesShort: ['日','月','火','水','木','金','土'],
		header: {
			left: '',
			center: '',
			right: ''
		},
		titleFormat: {
			month: 'yyyy年 M月',
			week: '[yyyy年 ]M月 d日{ —[yyyy年 ][ M月] d日}',
			day: 'yyyy年 M月 d日 dddd'
		},
		buttonText: {
			today: '今日'
		},
		eventClick: function(calEvent, jsEvent, view) {
			//var y = calEvent.start.getFullYear();
			//var m = calEvent.start.getMonth()+1;
			//var d = calEvent.start.getDate();
			//location.href = "event_form.php?y=" + y + "&m=" + m + "&d=" + d + "&b=" + calEvent.id;
		},
		//eventDragStart: function(calEvent, jsEvent, view) {
		//	beforeMoveStart = calEvent.start;
		//	beforeMoveEnd = calEvent.end;
		//},
		//eventDrop: function(calEvent, jsEvent, view) {
		//	alert(calEvent.title +"\n"+ beforeMoveStart +" -> "+ calEvent.start +"\n"+ beforeMoveEnd +" -> "+ calEvent.end);
		//},
		events : []
	});

	var classes = ["hide","publ","prep"];
	var date = new Date();
	var yy = date.getFullYear();
	var thisMonth = date.getMonth();
	var mm = ((""+thisMonth).length == 1) ? Number("0"+thisMonth) : thisMonth;

	var nextMonth = (mm+1 == 13) ? "01" : mm+1;
	if((""+nextMonth).length == 1){nextMonth = "0"+nextMonth;}
	var nextYear = (nextMonth == "01") ? yy+1 : yy;
	var prevMonth = (mm-1 == 0 || mm-1 == -1) ? "12" : mm-1;
	if((""+prevMonth).length == 1){prevMonth = "0"+prevMonth;}
	var prevYear = (prevMonth == "12") ? yy-1 : yy;

	var days = {
		"01":"31",
		"02":"28",
		"03":"31",
		"04":"30",
		"05":"31",
		"06":"30",
		"07":"31",
		"08":"31",
		"09":"30",
		"10":"31",
		"11":"30",
		"12":"31"
	}

	var jFrom = "" + prevYear +""+ prevMonth +""+ days[prevMonth];
	var jTo = "" + nextYear +""+ nextMonth +""+ days[nextMonth];

	$.getJSON("http://sitemanage.shift-jp.net/web-admin/event_form.php?",
	{
		mode: "get",
		from: jFrom,
		to:jTo
	},
	function(data) {
		for(var i=0; i < data.length; i++){

			var cl = (data[i].color != "") ? "" : classes[data[i].status];

			calendar.fullCalendar('renderEvent',
				{
					id: data[i].id,
					title: data[i].event,
					start: data[i].start_date,
					end: data[i].end_date,
					allDay: true,
					color:"#"+data[i].color,
					textColor:"#ffffff",
					className: cl
				},
				true // make the event "stick"
			);
		}
	});

	$('#thisDate').html("<em>g</em>" + yy +"/"+ (thisMonth+1) + "の予定");


	/*-- インフォメーション --------------------------------------------------------------------*/

	var informationModal = $('#informationModal');
	var informationPopup = function(type,n){

		var url = 'information_popup_' + type + '.php';
		if(n){url += "?param=" + n;}

		if(informationModal.size() == 0){
			var html = '<div id="informationModal" class="mcon">';
			html += '<span class="close_btn"><a href="javascript:;">b</a></span>';
			html += '<h3>Information</h3>';
			html += '<iframe id="informationModal_i" src="'  + url + '"></iframe>';
			html += '</div>';
			$('body').append(html);
			$("#informationModal").draggable({handle:"h3"});
		}else {
			$('#informationModal_i').attr('src',url);
		}

		toggleInfoModal(true);

	}

	var toggleInfoModal = function(s){
		if(s == true){
			$('body').append('<div id="modal_background">&nbsp;</div>');
			$('#modal_background').fadeIn(300).height($(document).height());
			informationModal
				.show()
				.css({
					"position":"absolute",
					"opacity":0,
					'top':($(document).scrollTop())+'px'})
				.animate({"opacity":1,"top":($(document).scrollTop()+50)+"px"},300);
			$('#modal_background , .close_btn').click(function(){
				toggleInfoModal(false);
			});
		}else {
			$('#modal_background').fadeOut(300,function(){$(this).remove();});
			informationModal
				.css({"position":"absolute"})
				.animate({"opacity":0,"top":$(document).scrollTop()+'px'},300,
				function(){
					$(this).hide();
				});
		}
	}

	var information = $("#information");
	$('.page',information).live('click',function(){
		var t = $(this).data('tar');
		var i = $(this).data('id');
		informationPopup(t,i);
	});

	$('.more',information).live('click',function(){
		var t = $(this).data('tar');
		var i = null;
		informationPopup(t,i);
	});

	/*-- グラフ --------------------------------------------------------------------*/

	$('.hcTable').hcrender();

	var gbtn = $(".graph .btns_mini");
	$('.left a' , gbtn).click(function(){
		var p = $(this).closest("section");
		$("div,table",p).hide();
		$("div",p).show();
	});

	$('.right a' , gbtn).click(function(){
		var p = $(this).closest("section");
		$("div,table",p).hide();
		$("table",p).show();
	});


	/*-- プラグイン --------------------------------------------------------------------*/

	var container = $('#module_container');

	var set_compact_event = function(b){
		if(b){
			$('.compact div').unbind().hover(
				function(){
					var top = ($('ul',this).height()+136);
					$('ul',this)
						.slideDown(200);
				},
				function(){
					$('ul',this).slideUp(200);
				}
			);
			$('div ul',container).hide();
		}else {
			$('.open div').unbind();
			$('div ul',container).show();
		}
	}

	var mid = $('.btns_medium',modules);
	var min = $('.btns_mini',modules);

	var ps_btn = $('a',mid);
	ps_btn.click(function(){
		ps_btn.removeClass("active");
		$(this).addClass("active");
		var s = $(this).data("style");
		container.removeClass("mono , color").addClass(s);
		$.cookie('plugin_style', s, {expires : 30});
	});


	$('.left a',min).click(function(){
		if(!container.hasClass('open')){
			container.fadeOut(duration,function(){
				container
					.removeClass("compact")
					.addClass("open")
					.fadeIn(duration);
					set_compact_event(false);
			});

			$.cookie('plugin_mode', 'open', {expires : 30});
		}
	});

	$('.right a',min).click(function(){
		if(!container.hasClass('compact')){
			container.fadeOut(duration,function(){
				container
					.removeClass("open")
					.addClass("compact")
					.fadeIn(duration);
					set_compact_event(true);
			});

			$.cookie('plugin_mode', 'compact', {expires : 30});
		}
	});


	/*-- cookieから配置再現 --------------------------------------------------------------------*/

	var ps = $.cookie('plugin_style');
	container.addClass(ps);
	if(ps == 'mono'){
		$('.right a',mid).addClass('active');
	}else {
		$('.left a',mid).addClass('active');
	}

	if($.cookie('plugin_mode') == 'compact'){
		container.addClass('compact');
		$('.right a',min).addClass('active');
		set_compact_event(true);
	}else {
		container.addClass('open');
		$('.left a',min).addClass('active');
	}

	var max = $(' > section',sections).length -1 ;
	for(var i = max; i >= 0; i--){
		var section_id = $.cookie('section'+i);
		$('section[name='+section_id+']').prependTo('#sections');
	}

	/*-- 折りたたみ --------------------------------------------------------------------*/

/*
	var min_h = $('h3',sections).height();
	var top_content = $('.top_content');

	top_content.each(function(){
		$(this).attr("rel",$(this).height());
	});

	$('h3.ctrl',top_content).click(function(){
		var p = $(this).closest(".top_content");
		var h = min_h;

		if(p.height() == min_h){
			$('h3 em',p).text('g');
			h = p.attr("rel");
		}else {
			$('h3 em',p).text('j');
		}
		p
			.animate({
				"height":h+"px"
			},300);
	});
*/

	$('> .half',sections).autoHeight({column:2});
	sections.css("visibility","visible")
	$('#article').removeClass("load");

});

$(function () {

	/**
	 * Get the current time
	 */
	function getNow () {
	    var now = new Date();

	    return {
	        hours: now.getHours() + now.getMinutes() / 60,
	        minutes: now.getMinutes() * 12 / 60 + now.getSeconds() * 12 / 3600,
	        seconds: now.getSeconds() * 12 / 60
	    };
	};

	/**
	 * Pad numbers
	 */
	function pad(number, length) {
		// Create an array of the remaining length +1 and join it with 0's
		return new Array((length || 2) + 1 - String(number).length).join(0) + number;
	}

	var now = getNow();

	// Create the chart
	var chart = new Highcharts.Chart({

	    chart: {
	        renderTo: 'timeR',
	        type: 'gauge',
	        plotBackgroundColor: null,
	        plotBackgroundImage: null,
	        plotBorderWidth: 0,
	        plotShadow: false,
	        height: 240
	    },

	    credits: {
	        enabled: false
	    },

	    title: {
	    	text: ''
	    },

	    pane: {
	    	background: [{
	    		// default background
	    	}, {
	    		// reflex for supported browsers
	    		backgroundColor: Highcharts.svg ? {
		    		radialGradient: {
		    			cx: 0.5,
		    			cy: -0.4,
		    			r: 1.9
		    		},
		    		stops: [
		    			[0.5, 'rgba(255, 255, 255, 0.2)'],
		    			[0.5, 'rgba(200, 200, 200, 0.2)']
		    		]
		    	} : null
	    	}]
	    },

	    yAxis: {
	        labels: {
	            distance: -20
	        },
	        min: 0,
	        max: 12,
	        lineWidth: 0,
	        showFirstLabel: false,

	        minorTickInterval: 'auto',
	        minorTickWidth: 1,
	        minorTickLength: 5,
	        minorTickPosition: 'inside',
	        minorGridLineWidth: 0,
	        minorTickColor: '#666',

	        tickInterval: 1,
	        tickWidth: 2,
	        tickPosition: 'inside',
	        tickLength: 10,
	        tickColor: '#666',
	        title: {
	            text: 'Powered by<br/>Highcharts',
	            style: {
	                color: '#BBB',
	                fontWeight: 'normal',
	                fontSize: '8px',
	                lineHeight: '10px'
	            },
	            y: 10
	        }
	    },

	    tooltip: {
	    	formatter: function () {
	    		return chart.tooltipText;
	    	}
	    },

	    series: [{
	        data: [{
	            id: 'hour',
	            y: now.hours,
	            dial: {
	                radius: '60%',
	                baseWidth: 4,
	                baseLength: '95%',
	                rearLength: 0
	            }
	        }, {
	            id: 'minute',
	            y: now.minutes,
	            dial: {
	                baseLength: '95%',
	                rearLength: 0
	            }
	        }, {
	            id: 'second',
	            y: now.seconds,
	            dial: {
	                radius: '100%',
	                baseWidth: 1,
	                rearLength: '20%'
	            }
	        }],
	        animation: false,
	        dataLabels: {
	            enabled: false
	        }
	    }]
	},

	// Move
	function (chart) {
	    setInterval(function () {
	        var hour = chart.get('hour'),
	            minute = chart.get('minute'),
	            second = chart.get('second'),
	            now = getNow(),
	            // run animation unless we're wrapping around from 59 to 0
	            animation = now.seconds == 0 ?
	                false :
	                {
	                    easing: 'easeOutElastic'
	                };

	        // Cache the tooltip text
	        chart.tooltipText =
				pad(Math.floor(now.hours), 2) + ':' +
	    		pad(Math.floor(now.minutes * 5), 2) + ':' +
	    		pad(now.seconds * 5, 2);

	        hour.update(now.hours, true, animation);
	        minute.update(now.minutes, true, animation);
	        second.update(now.seconds, true, animation);

	    }, 1000);

	});
});

// Extend jQuery with some easing (copied from jQuery UI)
$.extend($.easing, {
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	}
>>>>>>> .r117
});